﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuddHa.Common.FileExportOpex.Pdf.Example
{
    public class ReceiptModel : ExportModel
    {
        public string? Title { get; set; }

        public List<ReceiptInfoInputsModel>? ReceiptInfoInputs { get; set; }

        public class ReceiptInfoInputsModel
        {
            public string? Code { get; set; }

            public string? Name { get; set; }

            public string? IdNo { get; set; }

            public string? Amount { get; set; }

            public string? UppercaseAmount { get; set; }

            public string? PaymentMethod { get; set; }

            public string? TradeStatus { get; set; }

            public string? Remark { get; set; }

            public string? Grade { get; set; }

            public string? Profession { get; set; }

            public DateTime TradeTime { get; set; }
        }

        /// <summary>
        /// 文件保存地址
        /// </summary>
        /// <param name="pathHeader"></param>
        /// <returns></returns>
        public override string CreateExportPath(string pathHeader = "")
        {
            if (string.IsNullOrWhiteSpace(pathHeader))
            {
                pathHeader = AppDomain.CurrentDomain.BaseDirectory;
            }
            return Path.Combine(pathHeader, "yyyy", "ss-dd");
        }

        /// <summary>
        /// 文件名
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public override string CreateFileName(string fileName = "")
        {
            if (string.IsNullOrWhiteSpace(fileName))
            {
                fileName = "123456";
            }
            return "电子收款凭证-" + fileName + ".pdf";
        }
    }
}
